home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-09-13 | 46.6 KB | 1,221 lines |
- '**************************************************************************
- '* MSSetup Toolkit Sample 1
- '**************************************************************************
-
- '''$DEFINE ''Define for script development/debugging
-
- '$INCLUDE 'setupapi.inc'
- '$INCLUDE 'msdetect.inc'
-
-
- ''Dialog ID's (mine)
- '$INCLUDE 'dialogid.inc'
- '$INCLUDE 'symbols.inc'
-
- ''Const integers
- CONST c_iMINIMUM= 1499
- CONST c_iDISKIMAGE= 1500
- CONST c_iCOMPLETE = 1501
- CONST c_iCUSTOM = 1502
- CONST c_iNETADMIN = 1503
- CONST c_iRETRY = 1504
- CONST c_iPORT = 1505
- CONST c_iSKIP = 1506
- CONST c_iSELECT_COMPONENTS = 1509
- CONST c_iSELECT_PORT = 1510
- CONST c_iSELECT_PRINTER = 1511
- CONST c_iREBOOT = 1515
- CONST c_iRESUME = 1516
- CONST c_iBACK = 1517
- CONST c_iCONTINUE = 1518
- CONST c_iEXIT = 1519
- CONST c_iOK = 1520
- CONST c_iCANCEL = 1521
- CONST c_iYES = 1522
- CONST c_iNO = 1523
- CONST c_iINVALID = -999
- CONST c_iGO_BACK = 3001
-
- CONST EW_REBOOTSYSTEM = 67
- CONST EW_RESTARTWINDOWS = 66
-
- '' These need to be the same number as in resource.h
- const IDS_STATWIN_TITLE% = 200
- const IDS_INFO_FILE_NAME% = 1
- const IDS_CORRUPT_SETUP_FILE% = 2
- const IDS_ABORT_INSTALL% = 3
- const IDS_NO_SELECTIONS% = 4
- const IDS_UNABLE_ALADDIN_1% = 5
- const IDS_UNABLE_ALADDIN_2% = 6
- const IDS_UNABLE_ALADDIN_3% = 7
- const IDS_UNABLE_ALADDIN_CAP% = 8
- const IDS_NETADMIN_1% = 9
- const IDS_NETADMIN_2% = 10
- const IDS_SYSTEM_TITLE% = 100
-
- CONST c_iPROGRESS_WIDTH = 220 '' Width of the progress indicator
- CONST c_iPROGRESS_HEIGHT = 100 '' Height of the progress indicator
-
- CONST c_iPT_LOCAL = 1 '' Used for Port connections, could be network mapping or local connect.
- CONST c_iPT_NETWORK = 2
-
- ''Const DLL dialog functions
- CONST c_szWELCOME_DLG_PROC$ = "WelcomeDlgProc"
- CONST c_szMETHOD_DLG_PROC$ = "MethodDlgProc"
- CONST c_szNETADMIN_DLG_PROC$ = "NetAdminInfoDlgProc"
- CONST c_szPORT_DLG_PROC$ = "PortDlgProc"
- CONST c_szBIDI_PROBLEM_DLG_PROC$ = "BidiProbDlgProc"
- CONST c_szUNSUPPORTED_DLG_PROC$ = "UnsupportedDlgProc"
- CONST c_szPRINTER_DLG_PROC$ = "PrinterDlgProc"
- CONST c_szCOMPONENT_DLG_PROC$ = "ComponentDlgProc"
- CONST c_szNOSPACE_DLG_PROC$ = "NoSpaceDlgProc"
- CONST c_szVERIFY_DLG_PROC$ = "VerifyDlgProc"
- CONST c_szVERIFY_FAIL_DLG_PROC$ = "VerifyFailDlgProc"
- CONST c_szFINAL_DLG_PROC$ = "FinalDlgProc"
- CONST c_szFINAL_ADMIN_DLG_PROC$ = "FinalDlgProc"
- CONST c_szREBOOT_DLG_PROC$ = "RebootDlgProc"
- CONST c_szEXIT_DLG_PROC$ = "ExitDlgProc"
- CONST c_szBILLBOARD_DLG_PROC$ = "BillboardDlgProc"
- CONST c_szINVISIBLE_DLG_PROC$ = "InvisibleDlgProc"
- CONST c_szHPLOGO_DLG_PROC$ = "HPLogoDlgProc"
- CONST c_szEXECUTE_DLG_PROC$ = "ExecuteDlgProc"
- CONST c_szALADDIN_DLG_PROC$ = "AladdinDlgProc"
- CONST c_szCOPYRIGHT_DLG_PROC$ = "CopyRightDlgProc"
- CONST c_szDISK_IMAGE_DLG_PROC$ = "DiskImageDlgProc"
- CONST c_szUPDATE32_TEMPFILE$ = "UPDATE32.TMP"
-
- ''Const strings
- CONST c_szEMPTY$ = ""
- CONST c_szLOG_FILE$ = "HPLJ5SIM.LOG"
- CONST c_szINFO_FILE$ = "SETUP.INF"
- CONST c_szLOG_FILE_LIST$ = "logfile"
- CONST c_szFAILURE$ = "fail"
- CONST c_szSUCCESS$ = "success"
- CONST c_szALADDIN$ = "fontsmart.comp"
- CONST c_szALADDIN_CUSTOM$ = "fontsmart.custom.fonts"
- const c_szALL_FONTS$ = "fontsmart.all.fonts"
- CONST c_szALADDIN_CMD_LINE$ = "fontsmrt /b "
- const c_szFONTLIST_PCL$ = "fontlist.pcl"
- const c_szFONTLIST_PS$ = "fontlist.ps"
- const c_szALLFONTS_FILE$ = "allfonts.txt"
- const c_szALADDIN_EXIT_MSG$ = "FontSmartExiting"
-
- CONST c_lpszSECTION_LIST$ = "ComponentSectionList"
- CONST c_lpszCOMPONENT_LIST$ = "ComponentList"
- CONST c_lpszINSTALL_STRING_LIST$ = "InstallStringList"
- CONST c_szMSCUISTF = "MSCUISTF.DLL"
- CONST c_sz95HELPFILE$ = "hpinstal.gid"
-
- ''Support DLL
- '$INCLUDE 'support.inc'
-
- ''Bitmap ID
- CONST LOGO = IDB_HP_LOGO
-
- ''Message IDs
- CONST WM_USER = 1024 '' 0x0400
- CONST WM_CLEANUP = WM_USER + 200
-
-
- GLOBAL g_iReturn as integer
- GLOBAL g_dwBidiReady as long
- GLOBAL g_hWndFrame as integer
- GLOBAL g_iMethod as integer
- GLOBAL g_iInstallOk as integer
- GLOBAL g_szClose as string
- GLOBAL g_pEnvironment as pointer to ENVIRONMENT
- GLOBAL g_szDest as string
- GLOBAL g_iIsChicago as integer
-
- DECLARE FUNCTION Install() as INTEGER
- DECLARE FUNCTION MakePath( szDir$, szFile$ ) AS STRING
-
- DECLARE FUNCTION DoMyMsgBox(iCap%, iMsg%, wType%) as integer
- DECLARE FUNCTION LogUserOptions() as integer
- DECLARE FUNCTION LogEnvironment() as integer
- DECLARE FUNCTION LogInstallation(szSection$) as integer
- DECLARE FUNCTION CopyFiles() as integer
- DECLARE FUNCTION SetupUIDlg(szDll$, idDlg%, szDlgProc$,idHelpDlg%, szHelpProc$) as integer
- DECLARE FUNCTION GetButtonId(szString$) as integer
- DECLARE function MergeStrings(szStr1$, szStr2$) as string
- declare sub Clean()
- declare function DoAladdin() as integer
- declare function GetInstString(iStringId%) as string
-
- declare function GetGaugeDlgUnitsX lib "mscuistf.dll" () as integer
- declare function GetGaugeDlgUnitsY lib "mscuistf.dll" () as integer
- declare function EnoughSpace lib "mscuistf.dll" () as integer
- declare function SetExecBlock lib "mscuistf.dll" (lpszCmdLine$, lpszExitMsg$) as integer
- declare function GetExecBlockReturn lib "mscuistf.dll" () as integer
-
- '' Windows API functions
- declare function GetNumTasks lib "Kernel" () as integer
- declare function GetModuleHandle lib "Kernel" (lpstr$) as integer
- declare function WinExec lib "Kernel" (szCommand$, uiShow%) as integer
- declare function lstrcat lib "Kernel" (g_szDest$, szSource$) as long
- declare function lstrlen lib "Kernel" (szSource$) as integer
- declare function GetFreeSpace lib "Kernel" (iFlags%) as long
-
-
-
- '$IFNDEF MSTEST_20
- declare function ExitWindows lib "user" (dwRestart&, iReserved%) as integer
- '$ENDIF
-
- '$IFDEF DEBUG
- declare sub OutputDebugString lib "Kernel" ( szStr$)
- '$ENDIF
-
- INIT:
- dim iReturn as integer
- dim szDialogProc as string
- dim iIdDialog as integer
- dim iSuccess as integer
- dim ipSuccess as pointer to integer
- dim iProcessor as integer
- dim iPortType as integer
-
- ipSuccess = VARPTR( iSuccess )
-
- g_hWndFrame = HwndFrame()
- ''
- '' Moved this call to FixMainWindow To support getting verion info for NT
- ''
- iReturn = FixMainWindow( g_hWndFrame )
-
- g_iReturn = Initialize()
- SetTitle GetInstString(IDS_SYSTEM_TITLE)
-
- if InstallOnThisOS() = 0 then
- goto QUIT
- endif
- '' Initialize empty lists
- SetSymbolValue c_szLOG_FILE_LIST , c_szEMPTY
- SetSymbolValue c_szFAILURE , c_szEMPTY
- SetSymbolValue c_szSUCCESS , c_szEMPTY
-
-
- szInf$ = GetSymbolValue("STF_SRCINFPATH")
- IF szInf$ = c_szEMPTY THEN
- szInf$ = GetSymbolValue("STF_CWDDIR") + "SETUP.INF"
- END IF
- ReadInfFile szInf$
-
-
- g_pEnvironment = GetInstallEnvironment()
- ''g_pEnvironment[0].iOSIsNT = 0
- ''g_pEnvironment[0].iOSMajor = 3
- ''g_pEnvironment[0].iOSMinor = 10
-
- ''
- '' Check for Win95. OS major is >= 4 or OS major is 3 and OS minor > 11
- ''
- g_iIsChicago = 0
- if g_pEnvironment[0].iOSMajor >= 4 then
- g_iIsChicago = 1
- endif
- if g_pEnvironment[0].iOSMajor = 3 AND g_pEnvironment[0].iOSMinor > 11 then
- g_iIsChicago = 1
- endif
-
- g_szDest = UIStartDlg(c_szMSCUISTF$, IDD_HPLOGO, c_szHPLOGO_DLG_PROC,0,c_szEMPTY)
-
- g_szDest = UIStartDlg(c_szMSCUISTF$, IDD_COPYRIGHT, c_szCOPYRIGHT_DLG_PROC,0,c_szEMPTY)
- '' Have the script send a beep when requesting new diskettes.
- iReturn = SetBeepingMode(1)
-
- iReturn = LogEnvironment()
- iProcessor = GetProcessorType()
- szDialogProc = c_szWELCOME_DLG_PROC
- iIdDialog = IDD_WELCOME
- g_pEnvironment = GetInstallEnvironment
-
- GOBACK:
- iPortType = c_iPT_LOCAL
-
- WHILE szDialogProc <> c_szEMPTY
- iReturn = SetupUIDlg(c_szMSCUISTF$, iIdDialog, szDialogProc, 0, c_szEMPTY)
-
- if (iReturn = c_iEXIT) then
- GOSUB ASKQUIT
- else
- '' This is need to prevent having a duplicate case, since this *@($(!* (stupid)
- '' scripting language wont let your cases fall through to the next case.
- if (iIdDialog = IDD_METHOD_SHARED) then
- iIdDialog = IDD_METHOD_NONET
- endif
-
-
- UIPop 1
- SELECT CASE iIdDialog
- CASE IDD_WELCOME
- ''
- '' If other tasks are running and we are not in the ultimate
- '' in multasking os, NT! then put up a warning dialog message
- ''
- if ( ( GetTaskCount() > 0) AND ( g_pEnvironment[0].iOSIsNT = 0) ) then
- iIdDialog = IDD_TASK_PROMPT
- szDialogProc = c_szWELCOME_DLG_PROC
- else
- g_szDest = g_pEnvironment[0].szSystemDir[0]
- if (0 = IsDirWritable(g_szDest) ) then
- iIdDialog = IDD_METHOD_SHARED
- szDialogProc = c_szMETHOD_DLG_PROC
- elseif (g_pEnvironment[0].iInstallType = IT_STANDALONE) then
- iIdDialog = IDD_METHOD_NONET
- szDialogProc = c_szMETHOD_DLG_PROC
- else
- iIdDialog = IDD_METHOD
- szDialogProc = c_szMETHOD_DLG_PROC
- endif
- endif
- iReturn = LogInstallation("[TaskList]")
-
- CASE IDD_TASK_PROMPT
- g_szDest = g_pEnvironment[0].szSystemDir[0]
- if (0 = IsDirWritable(g_szDest) ) then
- iIdDialog = IDD_METHOD_SHARED
- szDialogProc = c_szMETHOD_DLG_PROC
- elseif (g_pEnvironment[0].iInstallType = IT_STANDALONE) then
- iIdDialog = IDD_METHOD_NONET
- szDialogProc = c_szMETHOD_DLG_PROC
- else
- iIdDialog = IDD_METHOD
- szDialogProc = c_szMETHOD_DLG_PROC
- endif
-
- CASE IDD_METHOD
- g_iMethod = iReturn
-
- if iReturn = c_iNETADMIN then
- iIdDialog = IDD_ADMIN_INFO
- szDialogProc = c_szNETADMIN_DLG_PROC
- else
- iIdDialog = IDD_SELECT_PORT
- szDialogProc = c_szPORT_DLG_PROC
- endif
- iReturn = ReadInfoFile(iProcessor)
- if iReturn <> 0 then
- if iReturn <> c_iDO_NET_ADMIN then
- iReturn = DoMyMsgBox( IDS_CORRUPT_SETUP_FILE, IDS_ABORT_INSTALL, MB_OK or MB_APPLMODAL or MB_ICONSTOP )
- else
- g_szDest = GetInstString(IDS_NETADMIN_1) + GetInstString(IDS_NETADMIN_2)
- iReturn = DoMsgBox( g_szDest, GetInstString(IDS_ABORT_INSTALL), MB_OK or MB_APPLMODAL or MB_ICONSTOP )
- endif
- goto QUIT
- elseif g_iMethod = c_iDISKIMAGE then
- if 0 = ReadAllFileGroups() then
- iIdDialog = IDD_DISKIMAGE
- szDialogProc = c_szDISK_IMAGE_DLG_PROC
- else
- iReturn = DoMyMsgBox( IDS_CORRUPT_SETUP_FILE, IDS_ABORT_INSTALL, MB_OK or MB_APPLMODAL or MB_ICONSTOP )
- goto QUIT
- endif
- elseif iIdDialog <> IDD_ADMIN_INFO AND CheckBidi() = 1 then
- iReturn = IsSupportedPrinterAttached( ipSuccess )
- if iReturn AND iSuccess = 1 then
- if 0 <> SetSelectionsForPrinter() then
- iReturn = DoMyMsgBox( IDS_CORRUPT_SETUP_FILE, IDS_ABORT_INSTALL, MB_OK or MB_APPLMODAL or MB_ICONSTOP )
- goto QUIT
- elseif 0 = ReadAllFileGroups() then
- if g_iMethod <> c_iCOMPLETE AND g_iMethod <> c_iMINIMUM then
- iIdDialog = IDD_SELECT_COMPONENTS
- szDialogProc =c_szCOMPONENT_DLG_PROC
- else
- szDialogProc = c_szEMPTY
- endif
- else
- iReturn = DoMyMsgBox( IDS_CORRUPT_SETUP_FILE, IDS_ABORT_INSTALL, MB_OK or MB_APPLMODAL or MB_ICONSTOP )
- goto QUIT
- endif
- elseif IsNetworked() = 0 then
- iIdDialog = IDD_SELECT_PORT
- szDialogProc = c_szPORT_DLG_PROC
- else
- iIdDialog = IDD_SELECT_NET_PORT
- szDialogProc = c_szPORT_DLG_PROC
- iPortType = c_iPT_NETWORK
- endif
- endif
-
- CASE IDD_METHOD_NONET
- g_iMethod = iReturn
- iReturn = ReadInfoFile(iProcessor)
- if iReturn <> 0 then
- if iReturn <> c_iDO_NET_ADMIN then
- iReturn = DoMyMsgBox( IDS_CORRUPT_SETUP_FILE, IDS_ABORT_INSTALL, MB_OK or MB_APPLMODAL or MB_ICONSTOP )
- else
- g_szDest = GetInstString(IDS_NETADMIN_1) + GetInstString(IDS_NETADMIN_2)
- iReturn = DoMsgBox( g_szDest, GetInstString(IDS_ABORT_INSTALL), MB_OK or MB_APPLMODAL or MB_ICONSTOP )
- endif
- goto QUIT
- elseif g_iMethod = c_iDISKIMAGE then
- if 0 = ReadAllFileGroups() then
- iIdDialog = IDD_DISKIMAGE
- szDialogProc = c_szDISK_IMAGE_DLG_PROC
- else
- iReturn = DoMyMsgBox( IDS_CORRUPT_SETUP_FILE, IDS_ABORT_INSTALL, MB_OK or MB_APPLMODAL or MB_ICONSTOP )
- goto QUIT
- endif
- else
-
- if CheckBidi() = 1 then
- iReturn = IsSupportedPrinterAttached( ipSuccess )
- if iReturn AND iSuccess = 1 then
- if 0 <> SetSelectionsForPrinter() then
- iReturn = DoMyMsgBox( IDS_CORRUPT_SETUP_FILE, IDS_ABORT_INSTALL, MB_OK or MB_APPLMODAL or MB_ICONSTOP )
- goto QUIT
- elseif 0 = ReadAllFileGroups() then
- if g_iMethod <> c_iCOMPLETE AND g_iMethod <> c_iMINIMUM then
- iIdDialog = IDD_SELECT_COMPONENTS
- szDialogProc =c_szCOMPONENT_DLG_PROC
- else
- szDialogProc = c_szEMPTY
- endif
- else
- iReturn = DoMyMsgBox( IDS_CORRUPT_SETUP_FILE, IDS_ABORT_INSTALL, MB_OK or MB_APPLMODAL or MB_ICONSTOP )
- goto QUIT
- endif
- elseif IsNetworked() = 1 then
- iIdDialog = IDD_SELECT_NET_PORT
- szDialogProc = c_szPORT_DLG_PROC
- iPortType = c_iPT_NETWORK
- else
- iIdDialog = IDD_SELECT_PORT
- szDialogProc = c_szPORT_DLG_PROC
- endif
- else
- if IsNetworked() = 1 then
- iIdDialog = IDD_SELECT_NET_PORT
- szDialogProc = c_szPORT_DLG_PROC
- iPortType = c_iPT_NETWORK
- else
- iIdDialog = IDD_SELECT_PORT
- szDialogProc = c_szPORT_DLG_PROC
- endif
- endif
- endif
-
- CASE IDD_DISKIMAGE
- if iReturn = c_iBACK then
- g_szDest = g_pEnvironment[0].szSystemDir[0]
- if (0 = IsDirWritable(g_szDest) ) then
- iIdDialog = IDD_METHOD_SHARED
- szDialogProc = c_szMETHOD_DLG_PROC
- elseif (g_pEnvironment[0].iInstallType = IT_STANDALONE) then
- iIdDialog = IDD_METHOD_NONET
- szDialogProc = c_szMETHOD_DLG_PROC
- else
- iIdDialog = IDD_METHOD
- szDialogProc = c_szMETHOD_DLG_PROC
- endif
- else
- szDialogProc = c_szEMPTY
- endif
-
- CASE IDD_ADMIN_INFO
-
- if iReturn = c_iBACK then
- iIdDialog = IDD_METHOD
- szDialogProc = c_szMETHOD_DLG_PROC
- else
- if CheckBidi() = 1 then
- iReturn = IsSupportedPrinterAttached( ipSuccess )
- if iReturn AND iSuccess = 1 then
- if 0 <> SetSelectionsForPrinter() then
- iReturn = DoMyMsgBox( IDS_CORRUPT_SETUP_FILE, IDS_ABORT_INSTALL, MB_OK or MB_APPLMODAL or MB_ICONSTOP )
- goto QUIT
- elseif 0 = ReadAllFileGroups() then
- iIdDialog = IDD_SELECT_COMPONENTS
- szDialogProc =c_szCOMPONENT_DLG_PROC
- else
- iReturn = DoMyMsgBox( IDS_CORRUPT_SETUP_FILE, IDS_ABORT_INSTALL, MB_OK or MB_APPLMODAL or MB_ICONSTOP )
- goto QUIT
- endif
- else
- iIdDialog = IDD_SELECT_PRINTER
- szDialogProc =c_szPRINTER_DLG_PROC
- endif
- else
- iIdDialog = IDD_SELECT_PRINTER
- szDialogProc =c_szPRINTER_DLG_PROC
- endif
-
- endif
-
- CASE IDD_SELECT_NET_PORT
-
- if iReturn = c_iBACK then
- g_szDest = g_pEnvironment[0].szSystemDir[0]
- if (0 = IsDirWritable(g_szDest) ) then
- iIdDialog = IDD_METHOD_SHARED
- szDialogProc = c_szMETHOD_DLG_PROC
- elseif (g_pEnvironment[0].iInstallType = IT_STANDALONE) then
- iIdDialog = IDD_METHOD_NONET
- szDialogProc = c_szMETHOD_DLG_PROC
- else
- iIdDialog = IDD_METHOD
- szDialogProc = c_szMETHOD_DLG_PROC
- endif
-
- else
- iIdDialog = IDD_SELECT_PRINTER
- szDialogProc =c_szPRINTER_DLG_PROC
- endif
-
-
- CASE IDD_SELECT_PORT
-
- if iReturn = c_iBACK then
- g_szDest = g_pEnvironment[0].szSystemDir[0]
- if (0 = IsDirWritable(g_szDest) ) then
- iIdDialog = IDD_METHOD_SHARED
- szDialogProc = c_szMETHOD_DLG_PROC
- elseif (g_pEnvironment[0].iInstallType = IT_STANDALONE) then
- iIdDialog = IDD_METHOD_NONET
- szDialogProc = c_szMETHOD_DLG_PROC
- else
- iIdDialog = IDD_METHOD
- szDialogProc = c_szMETHOD_DLG_PROC
- endif
- else
- if CheckBidi() = 1 then
- iReturn = TestBidi(g_pEnvironment[0].runTime.lpszPort[0])
- '' The return value could be true and have no bidi
- if iReturn <> 0 AND g_pEnvironment[0].runTime.bHasBidi = 0 then
- '' If we get here bidi could not be established, so the port type
- '' is something other than LPT
- iIdDialog = IDD_SELECT_PRINTER
- szDialogProc =c_szPRINTER_DLG_PROC
- elseif g_pEnvironment[0].runTime.bHasBidi = 0 then
- iIdDialog = IDD_BIDI_PROBLEM
- szDialogProc =c_szBIDI_PROBLEM_DLG_PROC
- elseif 0 < lstrlen(g_pEnvironment[0].runTime.lpszDeviceID[0]) then
-
- iReturn = IsPrinterSupported( g_pEnvironment[0].runTime.lpszDeviceID[0])
- if iReturn = 0 then
- iIdDialog = IDD_UNSUPPORTED_PRINTER
- szDialogProc =c_szUNSUPPORTED_DLG_PROC
- else
- iIdDialog = IDD_SELECT_PRINTER
- szDialogProc =c_szPRINTER_DLG_PROC
- endif
- else
- iIdDialog = IDD_SELECT_PRINTER
- szDialogProc =c_szPRINTER_DLG_PROC
- endif
-
- else
- iIdDialog = IDD_SELECT_PRINTER
- szDialogProc =c_szPRINTER_DLG_PROC
- endif
-
- endif
- CASE IDD_BIDI_PROBLEM
-
- if iReturn = c_iSKIP then
- iIdDialog = IDD_SELECT_PRINTER
- szDialogProc =c_szPRINTER_DLG_PROC
- elseif iReturn = c_iRETRY then
- iReturn = TestBidi(g_pEnvironment[0].runTime.lpszPort[0])
-
- if iReturn <> 0 AND g_pEnvironment[0].runTime.bHasBidi = 0 then
- '' If we get here bidi could not be established, so the port type
- '' is something other than LPT
- iIdDialog = IDD_SELECT_PRINTER
- szDialogProc =c_szPRINTER_DLG_PROC
- elseif g_pEnvironment[0].runTime.bHasBidi <> 0 then
- if 0 < lstrlen(g_pEnvironment[0].runTime.lpszDeviceID[0]) then
-
- iReturn = IsPrinterSupported( g_pEnvironment[0].runTime.lpszDeviceID[0])
- if iReturn = 0 then
- iIdDialog = IDD_UNSUPPORTED_PRINTER
- szDialogProc =c_szUNSUPPORTED_DLG_PROC
- else
- iIdDialog = IDD_SELECT_PRINTER
- szDialogProc =c_szPRINTER_DLG_PROC
- endif
- else
- iIdDialog = IDD_SELECT_PRINTER
- szDialogProc =c_szPRINTER_DLG_PROC
- endif
- endif
- elseif iReturn = c_iPORT then
- iIdDialog = IDD_SELECT_PORT
- szDialogProc = c_szPORT_DLG_PROC
- endif
-
- CASE IDD_SELECT_PRINTER
- if iReturn = c_iBACK then
- g_szDest = g_pEnvironment[0].szSystemDir[0]
- if (g_pEnvironment[0].iInstallType = IT_STANDALONE) or (0 = IsDirWritable(g_szDest) ) then
- if iPortType = c_iPT_NETWORK then
- iIdDialog = IDD_SELECT_NET_PORT
- szDialogProc = c_szPORT_DLG_PROC
- else
- iIdDialog = IDD_SELECT_PORT
- szDialogProc = c_szPORT_DLG_PROC
- endif
- else
- iIdDialog = IDD_METHOD
- szDialogProc = c_szMETHOD_DLG_PROC
- endif
-
- else
- if 0 <> SetSelectionsForPrinter() then
- iReturn = DoMyMsgBox( IDS_CORRUPT_SETUP_FILE, IDS_ABORT_INSTALL, MB_OK or MB_APPLMODAL or MB_ICONSTOP )
- goto QUIT
- elseif 0 = ReadAllFileGroups() then
- if g_iMethod <> c_iCOMPLETE AND g_iMethod <> c_iMINIMUM then
- iIdDialog = IDD_SELECT_COMPONENTS
- szDialogProc =c_szCOMPONENT_DLG_PROC
- else
- szDialogProc = c_szEMPTY
- endif
- else
- iReturn = DoMyMsgBox( IDS_CORRUPT_SETUP_FILE, IDS_ABORT_INSTALL, MB_OK or MB_APPLMODAL or MB_ICONSTOP )
- goto QUIT
- endif
- endif
-
- CASE IDD_UNSUPPORTED_PRINTER
- if iReturn = c_iSELECT_PORT then
- if iPortType = c_iPT_NETWORK then
- iIdDialog = IDD_SELECT_NET_PORT
- szDialogProc = c_szPORT_DLG_PROC
- else
- iIdDialog = IDD_SELECT_PORT
- szDialogProc = c_szPORT_DLG_PROC
- endif
- else
- iIdDialog = IDD_SELECT_PRINTER
- szDialogProc =c_szPRINTER_DLG_PROC
- endif
-
- CASE IDD_SELECT_COMPONENTS
- if iReturn = c_iBACK then
- if g_iMethod = c_iNETADMIN then
- iIdDialog = IDD_ADMIN_INFO
- szDialogProc = c_szNETADMIN_DLG_PROC
- elseif iReturn = c_iPORT then
- iIdDialog = IDD_SELECT_PRINTER
- szDialogProc =c_szPRINTER_DLG_PROC
- elseif iPortType = c_iPT_NETWORK then
- iIdDialog = IDD_SELECT_NET_PORT
- szDialogProc = c_szPORT_DLG_PROC
- else
- iIdDialog = IDD_SELECT_PORT
- szDialogProc = c_szPORT_DLG_PROC
- endif
- else
- szDialogProc = c_szEMPTY
- endif
-
-
- CASE IDD_NO_SPACE
- if iReturn = c_iSELECT_COMPONENTS then
- if g_iMethod = c_iDISKIMAGE then
- iIdDialog = IDD_DISKIMAGE
- szDialogProc = c_szDISK_IMAGE_DLG_PROC
- else
- iIdDialog = IDD_SELECT_COMPONENTS
- szDialogProc =c_szCOMPONENT_DLG_PROC
- endif
- else
- GOTO QUIT
- endif
- END SELECT
- endif
-
- if szDialogProc = c_szEMPTY then
- if EnoughSpace() = 0 then
- iIdDialog = IDD_NO_SPACE
- szDialogProc = c_szNOSPACE_DLG_PROC
- endif
- endif
- wend
-
- iReturn = AnyComponentsSelected()
- if iReturn = 0 then
- iReturn = DoMyMsgBox( IDS_NO_SELECTIONS,IDS_ABORT_INSTALL, 36)
- if iReturn = 6 then
- iIdDialog = IDD_SELECT_COMPONENTS
- szDialogProc =c_szCOMPONENT_DLG_PROC
- goto GOBACK
- endif
- goto QUIT
- elseif iReturn < 0 then
- iReturn = DoMyMsgBox( IDS_CORRUPT_SETUP_FILE, IDS_ABORT_INSTALL, MB_OK or MB_APPLMODAL or MB_ICONSTOP )
- goto QUIT
- endif
-
- if g_iMethod = c_iDISKIMAGE then
- iReturn = SetDecompMode(0)
- endif
-
- iReturn = FSetSymbolValue( c_lpszSECTION_LIST, c_szEMPTY)
- iReturn =FSetSymbolValue( c_lpszCOMPONENT_LIST, c_szEMPTY)
-
- SetRestartDir g_pEnvironment[0].szTempDir[0]
- '$IFDEF DEBUG
- WriteToLogFile "Restart Directory: "+ g_szDest
- OutputDebugString("Restarting at "+g_szDest+" ..." + chr$(10))
- '$ENDIF
-
- g_szDest = UIStartDlg( c_szMSCUISTF$, IDD_INVISIBLE, c_szINVISIBLE_DLG_PROC, 0, c_szEMPTY)
- if Install() = 0 then
- iCursor% = ShowWaitCursor
- '' Update .ini files
- iReturn = IniActionUpdate()
- iReturn = LogInstallation("[InstallTimeModificationsAdditions]")
-
- RestoreCursor iCursor%
- endif
-
- '' The next line make sure the setup window is the active window, it might not
- '' be if the program manager was called.
- UIPop 1
-
- iRestartWin32% = 0
- if g_iIsChicago = 1 OR g_pEnvironment[0].iOSIsNT = 1 then
-
- g_szDest = UIStartDlg( c_szMSCUISTF$, IDD_BILLBOARD_1,c_szBILLBOARD_DLG_PROC,0, c_szEMPTY)
- iCursor% = ShowWaitCursor
- iRestartWin32 = Copy32BitFiles()
- if 0 < iRestartWin32 then
- g_pEnvironment[0].runTime.bReboot = 1
- endif
-
- iReturn = LogInstallation("[Win32BitFileInstall]")
- RestoreCursor iCursor%
- UIPop 1
- ''
- '' Run the 32 bit executable to update the registry, and call the 32driver install
- ''
- g_szDest = MakePath(g_pEnvironment[0].szTempDir[0], c_szUPDATE32_TEMPFILE)
- '' Check to see if the file exists before we run the executable
- if DoesFileExist(g_szDest,femExists) then
- '' Make executable path
- g_szDest = MakePath(g_pEnvironment[0].szTempDir[0], "update32.exe")
- if SetExecBlock(g_szDest, "Update32Exiting") then
- g_szDest = UIStartDlg( c_szMSCUISTF, IDD_INVISIBLE, c_szEXECUTE_DLG_PROC, 0, c_szEMPTY)
- UIPop 1
- iReturn = GetExecBlockReturn()
-
- if iReturn < 32 then
- WriteToLogFile "ERROR!! Unable to start Update32.exe! Return Code: "+str$(iReturn)
- endif
- else
- WriteToLogFile "ERROR!! Unable to set the execution block! Internal System Error"
-
- endif
- endif
-
- endif
-
-
- if g_iMethod <> c_iDISKIMAGE then
- g_szDest = UIStartDlg( c_szMSCUISTF$, IDD_BILLBOARD_1,c_szBILLBOARD_DLG_PROC,0, c_szEMPTY)
- iReturn = DoAladdin()
- UIPop 1
- endif
-
- if 0 = GetListLength(c_szFAILURE) then
- if 0 <> GetListLength(c_szSUCCESS) then
- iReturn = SetupUIDlg(c_szMSCUISTF$, IDD_VERIFICATION,c_szVERIFY_DLG_PROC , 0, c_szEMPTY )
- UIPop 1
- endif
- else
- iReturn = SetupUIDlg(c_szMSCUISTF$, IDD_VERIFICATION_W_FAIL, c_szVERIFY_FAIL_DLG_PROC, 0, c_szEMPTY)
- UIPop 1
- endif
-
-
-
- if g_iMethod = c_iDISKIMAGE then
- iReturn = SetupUIDlg(c_szMSCUISTF$, IDD_FINAL_IMAGES, c_szFINAL_DLG_PROC, 0, c_szEMPTY)
- elseif g_iMethod = c_iNETADMIN then
- iReturn = SetupUIDlg(c_szMSCUISTF$, IDD_FINAL_ADMIN, c_szFINAL_ADMIN_DLG_PROC, 0, c_szEMPTY)
- elseif iPortType = c_iPT_NETWORK then
- iReturn = SetupUIDlg(c_szMSCUISTF$, IDD_FINAL_NET, c_szFINAL_DLG_PROC, 0, c_szEMPTY )
- else
- iReturn = SetupUIDlg(c_szMSCUISTF$, IDD_FINAL, c_szFINAL_DLG_PROC, 0, c_szEMPTY )
- endif
-
- UIPop 1
-
- if RestartListEmpty = 0 then
-
- WriteToLogFile "[RestartList]"
-
-
- RESTART:
- if iPortType = c_iPT_NETWORK then
- iReturn = SetupUIDlg(c_szMSCUISTF$, IDD_REBOOT_NET, c_szREBOOT_DLG_PROC, 0, c_szEMPTY)
- else
- iReturn = SetupUIDlg(c_szMSCUISTF$, IDD_ASK_REBOOT, c_szREBOOT_DLG_PROC, 0, c_szEMPTY)
- endif
-
- if iReturn = c_iREBOOT then
-
- Clean
- if ExitExecRestart = 0 then
- '$IFDEF DEBUG
- OutputDebugString("Error Restarting windows")
- '$ENDIF
-
- goto RESTART
- endif
- endif
- elseif iReturn = c_iCONTINUE AND (g_pEnvironment[0].runTime.bReboot OR iRestartWin32 > 0) then
- iReturn = SetupUIDlg(c_szMSCUISTF$, IDD_ASK_REBOOT, c_szREBOOT_DLG_PROC, 0, c_szEMPTY)
- if iReturn = c_iREBOOT then
-
- if CleanTempDir(g_pEnvironment[0].szTempDir[0]) = 0 then
- '$IFDEF DEBUG
- OutputDebugString("error deleting temp dir: "+ g_pEnvironment[0].szTempDir[0] + chr$(10))
- '$ENDIF
- endif
- Clean
-
- '$IFNDEF MSTEST_20
- ''
- '' If we are in NT then we need to do a different re-start method
- ''
- if g_pEnvironment[0].iOSIsNT = 1 then
- g_szDest = MergeStrings(g_pEnvironment[0].szSystemDir[0],"32\hpreboot.exe")
- iReturn = WinExec(g_szDest,SW_SHOWNORMAL )
- if iReturn < 32 then
- WriteToLogFile "ERROR!! Unable to start hpreboot.exe!.exe! Return Code: "+str$(iReturn)
- endif
- else
- iReturn = ExitWindows(EW_RESTARTWINDOWS, 0)
- endif
- '$ENDIF
- ''
- '' If user answered NO to the re-start question and the hpreboot.exe file is still there
- ''
- else
- g_szDest = MergeStrings(g_pEnvironment[0].szSystemDir[0],"32\hpreboot.exe")
- RemoveFile g_szDest, cmoForce
-
- endif '' cjg 1-19
- endif
-
-
- GOTO QUIT
-
-
- QUIT:
- Clean
- ''UIPop 1
-
- END
-
- ASKQUIT:
- iReturn = SetupUIDlg(c_szMSCUISTF$, IDD_EXIT_INCOMPLETE, c_szEXIT_DLG_PROC, 0, c_szEMPTY)
- if iReturn = c_iExit then
- UIPopAll
- ERROR STFQUIT
- else
- UIPop 1
- endif
-
- RETURN
-
- static sub Clean
-
- '$IFDEF DEBUG
- OutputDebugString "Cleaning up, CloseLogFile" + chr$(10)
- '$ENDIF
-
- CloseLogFile
-
-
- '' Check if this is the Windows95 OS, if so check for the
- '' existence of the .GID file.
- if g_iIsChicago = 1 then
- '' make the path to the .GID file
- g_szDest = MakePath(g_pEnvironment[0].szTempDir[0], c_sz95HELPFILE)
- '' Check to see if the file exists
- if DoesFileExist(g_szDest,femExists) then
- RemoveFile g_szDest, cmoForce
- endif
- endif
-
-
- '$IFDEF DEBUG
- OutputDebugString "Releasing info file..." +chr$(10)
- '$ENDIF
-
- iReturn = ReleaseInfoFile()
-
-
- '$IFDEF DEBUG
- OutputDebugString "calling support cleanup..." + chr$(10)
- '$ENDIF
-
- g_iReturn% = Cleanup()
-
-
-
- '$IFDEF DEBUG
- OutputDebugString "End of Clean up..." +chr$(10)
- '$ENDIF
-
- end sub
-
- STATIC FUNCTION DoMyMsgBox(iCap%, iMsg%, wType%) as integer
- szCap$ = GetInstString(iCap)
- szMsg$ = GetInstString(iMsg)
- DoMyMsgBox = DoMsgBox(szCap, szMsg, wType)
- END FUNCTION
-
- STATIC Function GetInstString(iStringId%) as string
-
- SetSymbolValue c_lpszINSTALL_STRING_LIST , c_szEMPTY
- iret% = GetInstallString(iStringId, c_lpszINSTALL_STRING_LIST)
- szString$ = GetListItem( c_lpszINSTALL_STRING_LIST, 1 )
- GetInstString = szString
- END FUNCTION
-
- STATIC Function MergeStrings (szStr1$, szStr2$) as string
- g_szDest = STRING$(len(szStr1) + len(szStr2) + 10, 0)
- lTemp& = lstrcat(g_szDest,szStr1)
- lTemp& = lstrcat(g_szDest,szStr2)
- MergeStrings = g_szDest
- END FUNCTION
-
- '**
- '** Purpose:
- '** Builds the copy list and performs all installation operations.
- '** Arguments:
- '** none.
- '** Returns:
- '** 0 on success, nonzero on error.
- '*************************************************************************
- FUNCTION Install() STATIC AS INTEGER
- dim iReturn as integer
-
- '' Save user's options to log file
- iReturn = LogUserOptions()
- ''handle iReturn <> 0
-
- iReturn = PutComponentsInCopyList( c_lpszSECTION_LIST, c_lpszCOMPONENT_LIST )
-
- '' if iReturn is true then the setup.hp file is corrupt.
- if iReturn then
- iReturn = DoMyMsgBox( IDS_CORRUPT_SETUP_FILE, IDS_ABORT_INSTALL, MB_OK or MB_APPLMODAL or MB_ICONSTOP )
- iReturn = c_iINVALID
-
- else
- '' Create copy list and copy files
- iReturn = CopyFiles()
- ''handle iReturn <> 0
- endif
- Install = iReturn
- END FUNCTION
-
-
- FUNCTION LogEnvironment() STATIC as integer
-
- ''$IFDEF LOG_PROTO
- dim szLogFile as STRING
- ''$ENDIF
-
- g_pEnvironment = GetInstallEnvironment()
-
- szTemp$ = g_pEnvironment[0].szWindowsDir[0]
-
- ''$IFDEF LOG_PROTO
- '' Get the System LogFile from the setup.hp file and put it in the LogFileSymbolTableList
- iRet% = GetSystemLogFile()
-
-
- if iRet = 0 then
- iRet = 1
- if GetListLength(c_szLOG_FILE_LIST) = 1 then
- szLogFile = GetListItem( c_szLOG_FILE_LIST, 1 )
- if lstrlen(szLogFile) > 0 then
- szLogFile = MakePath(szTemp$, szLogFile)
- iRet = 0
- endif
- endif
- endif
-
- if iRet = 1 then
- szLogFile = MakePath(szTemp$, c_szLOG_FILE)
- endif
- OpenLogFile szLogFile, 0
- ''$ENDIF
-
- '' OpenLogFile MakePath(szTemp$, c_szLOG_FILE), 0
-
- WriteToLogFile "[System Environment]"
- lFree& = GetFreeSpaceForDrive("C")
- if lFree > 1024 then
- lFree = lFree /1024
- endif
- lTotal& = GetTotalSpaceForDrive("C")
- if lTotal > 1024 then
- lTotal = lTotal / 1024
- endif
- WriteToLogFile "Disk Space: " + str$(lFree) + "K bytes free out of " + str$(lTotal) + "K bytes total space"
- lFreeMem = GetFreeSpace(0)
- if lFreeMem > 1024 then
- lFreeMem = lFreeMem / 1024
- endif
- WriteToLogFile "Memory: " + str$(lFreeMem) + "K bytes free"
- WriteToLogFile "Windows Version: " + str$(g_pEnvironment[0].iOSMajor) + " ." + str$(g_pEnvironment[0].iOSMinor)
- WriteToLogFile "Path: " + GetEnvVariableValue("PATH")
-
- WriteToLogFile MergeStrings("Windows Directory: ", g_pEnvironment[0].szWindowsDir[0])
- WriteToLogFile MergeStrings("System Directory: ", g_pEnvironment[0].szSystemDir[0])
- WriteToLogFile ""
- WriteToLogFile ""
-
- LogEnvironment = 0
- END FUNCTION
-
- FUNCTION LogInstallation(szSection$) STATIC as integer
- iLen% = GetListLength(c_szLOG_FILE_LIST)
- if 0 <> iLen then
- WriteToLogFile ""
- WriteToLogFile szSection
- iStart% = 1
- while iLen >= iStart
- WriteToLogFile GetListItem(c_szLOG_FILE_LIST, iStart)
- iStart = iStart + 1
- wend
- endif
- iLen = FSetSymbolValue( c_szLOG_FILE_LIST, c_szEMPTY)
- LogInstallation = 0
- END FUNCTION
-
-
- FUNCTION LogUserOptions() STATIC as integer
-
- DIM szTemp$
- WriteToLogFile "[User Selected Options]"
- g_pEnvironment = GetInstallEnvironment()
- SELECT CASE g_pEnvironment[0].runTime.iInstallMethod
-
- CASE IM_MINIMUM
- szTemp = "Minimum"
- CASE IM_COMPLETE
- szTemp = "Complete"
- CASE IM_CUSTOM
- szTemp = "Custom"
- CASE IM_NETADMIN
- szTemp = "Net Admin"
-
- END SELECT
- WriteToLogFile "Method of Installation : " + szTemp
-
- WriteToLogFile MergeStrings("Select Port: ", g_pEnvironment[0].runtime.lpszPort[0])
-
- WriteToLogFile MergeStrings("Select Printer: ",g_pEnvironment[0].runtime.lpszDeviceID[0] )
- WriteToLogFile ""
- WriteToLogFile ""
-
- LogUserOptions = 0
- END FUNCTION
-
- FUNCTION CopyFiles() STATIC as integer
- dim szSection as string
- dim szDest as string
- iReturn% = 0
-
- ClearCopyList
- ClearBillboardList
- iGaugeX% = GetGaugeDlgUnitsX()
- iGaugeY% = GetGaugeDlgUnitsY()
-
- iX% = ((g_pEnvironment[0].iDisplayX )/2 / iGaugeX) * 4
- iX = iX - (c_iPROGRESS_WIDTH)/8
- iY = 2
- SetCopyGaugePosition iX,iY
-
- AddToBillBoardList c_szMSCUISTF, IDD_BILLBOARD_1,c_szBILLBOARD_DLG_PROC,1
- AddToBillBoardList c_szMSCUISTF, IDD_BILLBOARD_2,c_szBILLBOARD_DLG_PROC,1
- AddToBillBoardList c_szMSCUISTF, IDD_BILLBOARD_3,c_szBILLBOARD_DLG_PROC,1
- AddToBillBoardList c_szMSCUISTF, IDD_BILLBOARD_4,c_szBILLBOARD_DLG_PROC,1
- AddToBillBoardList c_szMSCUISTF, IDD_BILLBOARD_5,c_szBILLBOARD_DLG_PROC,1
-
- SrcDir$ = GetSymbolValue("STF_SRCDIR")
- TempDir$ = g_pEnvironment[0].szTempDir[0]
-
- ReadInfFile MakePath(TempDir$, c_szINFO_FILE)
-
- iListLen% = GetListLength( c_lpszSECTION_LIST )
-
- while iListLen > 0
-
- szDest = GetListItem( c_lpszSECTION_LIST, iListLen )
- iListLen = iListLen - 1
- szSection = GetListItem( c_lpszSECTION_LIST, iListLen )
- iListLen = iListLen - 1
- '' If this is true then setup file is corrupted
- if lstrlen(szSection) = 0 OR lstrlen(szDest) = 0 then
- '$IFDEF DEBUG
- OutputDebugString( "Error Adding section: " + szSection + ", to dest: " + szDest + chr$(10) )
- '$ENDIF
- iReturn = c_iINVALID
- goto ABORT
- endif
- '$IFDEF DEBUG
- OutputDebugString( "Adding section: " + szSection + ", to dest: " + szDest + chr$(10) )
- '$ENDIF
- AddSectionFilesToCopyList szSection, srcDir, szDest '' MergeStrings(g_pEnvironment[0].szWindowsDir[0],c_szEMPTY)
- wend
- ''DumpCopyList "c:\copylist.txt"
- CopyFilesInCopyList
-
- ClearCopyList
- ClearBillboardList
-
- ABORT:
- RemoveSymbol c_lpszSECTION_LIST
- RemoveSymbol c_lpszCOMPONENT_LIST
- CopyFiles = iReturn
- END FUNCTION
-
-
- static FUNCTION DoAladdin() as integer
- if IsComponentSelected(c_szALADDIN) then
-
-
- if IsComponentSelected( c_szALADDIN_CUSTOM) then
- g_szDest = UIStartDlg( c_szMSCUISTF, IDD_ALADDIN, c_szALADDIN_DLG_PROC, 0, c_szEMPTY)
- UIPop 1
- else
-
- szDir$ = STRING$(MAX_PATH, 0)
- if GetComponentDir(c_szALADDIN, szDir) = 0 then
- '' handle this later
- endif
-
- szAladdin$ = c_szEMPTY
-
- if lstrlen(szDir) <> 0 then
- szAladdin = MakePath(szDir ,c_szALADDIN_CMD_LINE)
- else
- szAladdin = c_szALADDIN_CMD_LINE
- endif
-
- if IsComponentSelected( c_szALL_FONTS ) then
- szAladdin = szAladdin + MakePath(g_pEnvironment[0].szTempDir[0], c_szALLFONTS_FILE)
- elseif IsCurrentPrinterPostScript() = 1 then
- szAladdin = szAladdin + MakePath(g_pEnvironment[0].szTempDir[0], c_szFONTLIST_PS)
- else
- szAladdin = szAladdin + MakePath(g_pEnvironment[0].szTempDir[0], c_szFONTLIST_PCL)
- endif
- '$IFDEF DEBUG
- OutputDebugString " Aladdin CommandLine: " +szAladdin+chr$(10)
- '$ENDIF
- if SetExecBlock(szAladdin, c_szALADDIN_EXIT_MSG) then
- g_szDest = UIStartDlg( c_szMSCUISTF, IDD_INVISIBLE, c_szEXECUTE_DLG_PROC, 0, c_szEMPTY)
- UIPop 1
- iReturn = GetExecBlockReturn()
-
- if iReturn < 32 then
- g_szDest = GetInstString(IDS_UNABLE_ALADDIN_1) +" "+ GetInstString(IDS_UNABLE_ALADDIN_2) + GetInstString(IDS_UNABLE_ALADDIN_3)
- iRet% = DoMsgBox(g_szDest,GetInstString(IDS_UNABLE_ALADDIN_CAP) , MB_TASKMODAL+ 64 +MB_OK)
- UIPop 1
- else
- '' Since it worked, set iReturn to 0 so that we return success bdg 10/14/94
- iReturn = 0
- endif
-
- else
- '' There was a problem so tell the user how to run aladdin from the icon.
- g_szDest = UIStartDlg( c_szMSCUISTF, IDD_ALADDIN, c_szALADDIN_DLG_PROC, 0, c_szEMPTY)
- UIPop 1
- endif
- endif
- endif
- END FUNCTION
-
- '**
- '** Purpose:
- '** Appends a file name to the end of a directory path,
- '** inserting a backslash character as needed.
- '** Arguments:
- '** szDir$ - full directory path (with optional ending "\")
- '** szFile$ - filename to append to directory
- '** Returns:
- '** Resulting fully qualified path name.
- '*************************************************************************
- FUNCTION MakePath( szDir$, szFile$ ) STATIC AS STRING
- IF szDir$ = c_szEMPTY THEN
- MakePath = szFile$
- ELSE
- IF szFile$ <> c_szEMPTY THEN
- IF MID$(szDir$, lstrlen(szDir$), 1) <> "\" THEN
- szDir = MergeStrings(szDir, "\")
- ENDIF
- szDir = MergeStrings(szDir, szFile)
- ENDIF
- MakePath = szDir$
- END IF
- END FUNCTION
-
- STATIC FUNCTION SetupUIDlg(szDll$, idDlg%, szDlgProc$, idHelpDlg%, szHelpProc$) as integer
-
-
- sz$ = UIStartDlg( szDll, idDlg, szDlgProc, idHelpDlg, szHelpProc)
- iReturn% = GetButtonId(sz)
- SetupUIDlg = iReturn
-
- END FUNCTION
-
- STATIC FUNCTION GetButtonId(szString$) as integer
-
- SELECT CASE szString
- CASE IDC_COMPLETE_SYMBOL
- GetButtonId = c_iCOMPLETE
- CASE IDC_CUSTOM_SYMBOL
- GetButtonId = c_iCUSTOM
- CASE IDC_MINIMUM_SYMBOL
- GetButtonId = c_iMINIMUM
- CASE IDC_DISKIMAGE_SYMBOL
- GetButtonId = c_iDISKIMAGE
- CASE IDC_NETADMIN_SYMBOL
- GetButtonId = c_iNETADMIN
- CASE IDC_RETRY_SYMBOL
- GetButtonId = c_iRETRY
- CASE IDC_SKIP_SYMBOL
- GetButtonId = c_iSKIP
- CASE IDC_PORT_SYMBOL
- GetButtonId = c_iPORT
- CASE IDC_SELECT_COMPONENTS_SYMBOL
- GetButtonId = c_iSELECT_COMPONENTS
- CASE IDC_SELECT_PORT_SYMBOL
- GetButtonId = c_iSELECT_PORT
- CASE IDC_SELECT_PRINTER_SYMBOL
- GetButtonId = c_iSELECT_PRINTER
- CASE IDC_REBOOT_SYMBOL
- GetButtonId = c_iREBOOT
- CASE IDC_RESUME_SYMBOL
- GetButtonId = c_iRESUME
- CASE IDC_BACK_SYMBOL
- GetButtonId = c_iBACK
- CASE IDC_CONTINUE_SYMBOL
- GetButtonId = c_iCONTINUE
- CASE IDC_EXIT_SYMBOL
- GetButtonId = c_iEXIT
- CASE IDOK_SYMBOL
- GetButtonId = c_iOK
- CASE IDCANCEL_SYMBOL
- GetButtonId = c_iCANCEL
- CASE IDYES_SYMBOL
- GetButtonId = c_iYES
- CASE IDNO_SYMBOL
- GetButtonId = c_iNO
- CASE ELSE
- GetButtonId = c_iINVALID
-
- END SELECT
- END FUNCTION
-
-